var redis = require("redis")
var RDS_PORT = 6379
var RDS_HOST = "127.0.0.1"
var RDS_PWD = "MyRedis2018"
var RDS_OPTS = {auth_pass : RDS_PWD}
var redisDao = function() {
	this.db = false
}
redisDao.init = function(cb) {
	this.db = redis.createClient(RDS_PORT,RDS_HOST,RDS_OPTS)
	this.db.on("ready",(res) => {
		this.db.select("10",function(err) {
			console.log("redis ready")
			if(cb)
				cb()
		})
	})
}
redisDao.multi = function(list,cb) {
 	multi = this.db.multi(list).exec(function (err, replies) {
 		cb(err,replies)
 	})
}
module.exports = redisDao